package party.lovey.remote.client;

import party.lovey.remote.amq.Sender;
import party.lovey.remote.utils.Consts;
import party.lovey.remote.utils.ImageUtil;
import party.lovey.remote.utils.RobotUtil;

import javax.swing.*;
import java.awt.*;

/**
 * Created by huhaichao on 2017/4/26.
 */
public class ClientFrame extends JFrame {
    public ClientFrame() {
        this.setBounds(0, 0, 800, 600);
        this.setContentPane(new ScrollPane());
        this.setVisible(true);
        this.setTitle("远程桌面--控制端");
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) throws InterruptedException {
        while (true) {
            Sender.sendBinaryMessage(Consts.MESSAGE_IMAGE_SCREEN, ImageUtil.toBytes(RobotUtil.getScreenImage()));
            Thread.sleep(50);
        }

    }
}
